import request from "@/utils/service.js";

//----------------------------------查询---------------------------------

//查询电费所有数据
export let dianfei = () => {
    return request({
        url: "/hhpelect",
        method: 'GET'
    })
}
//查询电费单个数据
export let find = (id) => {
    return request({
        url: "/hhpelect/" + id,
        method: "GET",

    })
}

//查询停车费所有数据
export let parkfei = () => {
    return request({
        url: "/parking",
        method: 'GET'
    })
}
//查询停车费单个数据
export let carfind = (id) => {
    return request({
        url: "/parking/" + id,
        method: "GET",

    })
}

//-------------------------------------修改-------------------------------

//修改电费金额
export let electchange = (id, dianfei) => {
    return request({
        url: "/hhpelect/" + id,
        method: "PATCH",
        data: {
            dianfei
        }
    })
}
//修改电费缴费情况
export let electsituation = (id, dianfeisituation) => {
    return request({
        url: "/hhpelect/" + id,
        method: "PATCH",
        data: {
            dianfeisituation
        }
    })
}
//修改停车费金额
export let parkchange = (id, chefei) => {
    return request({
        url: "/parking/" + id,
        method: "PATCH",
        data: {
            chefei
        }
    })
}
//修改停车费缴费情况
export let parksituation = (id, carsituation) => {
    return request({
        url: "/parking/" + id,
        method: "PATCH",
        data: {
            carsituation
        }
    })
}
//--------------------------------------添加-------------------------------

//添加电费用户
export let dianfeiadd = (id, username, timestart, timeend, dianfeisituation, house, dianfei) => {
    return request({
        url: "/hhpelect",
        method: 'post',
        data: {
            id, username, timestart, timeend, house, dianfei, dianfeisituation
        }
    })
}
//添加停车费用户
export let caradd = (id, username, tel, car, cartype, cardid, carsituation, chefei) => {
    return request({
        url: "/parking",
        method: 'post',
        data: {
            id, username, tel, car, cardid, carsituation, chefei, cartype
        }
    })
}
//--------------------------------------删除-------------------------------

//删除电费单个数据
export let dianfeidel = (id) => {
    return request({
        url: "/hhpelect/" + id,
        method: "DELETE",
    })
}
//删除停车费单个数据
export let parkdel = (id) => {
    return request({
        url: "/parking/" + id,
        method: "DELETE",
    })
}



